package com.yfp.tissue.api;

import com.yfp.common.core.constant.ServiceNameConstants;
import com.yfp.common.core.domain.R;
import com.yfp.tissue.api.factory.RemotePositionFallbackFactory;
import com.yfp.tissue.domain.Position;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 
 * @version 1.0
 * @date 2024-08-13 15:52
 */
@FeignClient(contextId = "remotePositionService", value = ServiceNameConstants.TISSUE_SERVICE, fallbackFactory = RemotePositionFallbackFactory.class)
public interface RemotePositionService {

    @GetMapping("/position/info/byMachineId")
    @Operation(summary = "获取点位信息")
    R<Position> getInfoByMachineId(@ApiParam(value = "机器id") @RequestParam("machineId") String machineId);

    /**
     * 获取启用的点位列表
     */
    @GetMapping("/position/getPositionList")
    @Operation(summary = "获取启用的点位列表")
    public R<List<Position>> getPositionList(@RequestParam("cityName") String cityName);

}
